package com.fr.report.painter;

import com.fr.base.core.serializable.Point2DSerializable;
import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

class BiasLineSpan
  implements Cloneable, Serializable
{
  private Point2D startPoint;
  private Point2D endPoint;
  private double lineWidth;

  BiasLineSpan(Point2D paramPoint2D1, Point2D paramPoint2D2)
  {
    this.startPoint = paramPoint2D1;
    this.endPoint = paramPoint2D2;
    setLineWidth(paramPoint2D2.getX() - paramPoint2D1.getX());
  }

  public Point2D getStartPoint()
  {
    return this.startPoint;
  }

  public void setStartPoint(Point2D paramPoint2D)
  {
    this.startPoint = paramPoint2D;
  }

  public Point2D getEndPoint()
  {
    return this.endPoint;
  }

  public void setEndPoint(Point2D paramPoint2D)
  {
    this.endPoint = paramPoint2D;
  }

  public double getLineWidth()
  {
    return this.lineWidth;
  }

  public void setLineWidth(double paramDouble)
  {
    this.lineWidth = paramDouble;
  }

  private void readObject(ObjectInputStream paramObjectInputStream)
    throws ClassNotFoundException, IOException
  {
    paramObjectInputStream.defaultReadObject();
    Object localObject = paramObjectInputStream.readObject();
    if (localObject != null)
      this.startPoint = ((Point2DSerializable)localObject).getPoint2D();
    localObject = paramObjectInputStream.readObject();
    if (localObject != null)
      this.endPoint = ((Point2DSerializable)localObject).getPoint2D();
  }

  private void writeObject(ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    paramObjectOutputStream.defaultWriteObject();
    if (this.startPoint != null)
      paramObjectOutputStream.writeObject(new Point2DSerializable(this.startPoint));
    if (this.endPoint != null)
      paramObjectOutputStream.writeObject(new Point2DSerializable(this.endPoint));
  }
}